object ListProcessor {
  def addOne(list: List[Int]): List[Int] = list.map(_ + 1)

  def filterEven(list: List[Int]): List[Int] = list.filter(_ % 2 == 0)

  def mapReduce(list: List[Int])(mapFunc: Int => Int)(reduceFunc: (Int, Int) => Int): Int = 
    list.map(mapFunc).reduce(reduceFunc)
}

// 测试
  val list = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
  println(ListProcessor.addOne(list)) 
  println(ListProcessor.filterEven(list))
  println(ListProcessor.mapReduce(list)(x => x * 2)(_ + _)) 